package org.alex.sample.service.Impl;

import java.util.List;

import org.alex.sample.dao.ExamTestDAO;
import org.alex.sample.model.ExamTest;
import org.alex.sample.page.PagerModel;
import org.alex.sample.service.ExamTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ExamTestServiceImpl implements ExamTestService {
	
	@Autowired
	private ExamTestDAO examTestDao;

	@Override
	public List<ExamTest> findAllTest() throws Exception {
		List<ExamTest> examTestList = examTestDao.findAllExamTest();
		return examTestList;
	}

	@Override
	public ExamTest findTestById(Integer id) throws Exception {
		return examTestDao.findExamTestById(id);
	}

	@Override
	public void createTest(ExamTest examTest) throws Exception {
		examTestDao.createExamTest(examTest);
	}

	@Override
	public void editTest(ExamTest examTest) throws Exception {
		examTestDao.editExamTest(examTest);
	}

	@Override
	public void deleteTest(Integer id) throws Exception {
		examTestDao.deleteExamTest(id);
	}
	
	public PagerModel<ExamTest> findAllByPage() throws Exception{
		return examTestDao.findAllByPage();
	}

}
